package com.ruoyi.orders.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.orders.pojo.ZxGoods;
import com.ruoyi.orders.service.ZxGoodsService;
import com.ruoyi.orders.mapper.ZxGoodsMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
* @author 陈嘉俊
* @description 针对表【zx_goods(商品)】的数据库操作Service实现
* @createDate 2023-12-18 16:11:50
*/
@Service
public class ZxGoodsServiceImpl extends ServiceImpl<ZxGoodsMapper, ZxGoods> implements ZxGoodsService{

    @Resource
    private ZxGoodsMapper zxGoodsMapper;

    @Override
    public List<ZxGoods> getGoodsList(String keyword) {
        LambdaQueryWrapper<ZxGoods> queryWrapper = new LambdaQueryWrapper<>();
        if(!StringUtils.isEmpty(keyword)){
            queryWrapper.like(ZxGoods::getGoodsName,keyword);
        }
        return zxGoodsMapper.selectList(queryWrapper);
    }
}




